package com.chj.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.chj.entity.Park;
import com.chj.util.ResultSetUtil;
import com.etc.jdbc.mapper.RowMapper;

public class ParkMapper implements RowMapper<Park> {

    @Override
    public Park mapRow(ResultSet rs) throws SQLException {

        Park park = new Park();

        park.setParkId(ResultSetUtil.getString(rs, "park_id"));//parkId;//park_id varchar(32)
        park.setParkName(ResultSetUtil.getString(rs, "park_name"));//parkName;//park_name   varchar(32)
        park.setParkSize(ResultSetUtil.getString(rs, "park_size"));//parkSize;//park_size   decimal(3,0)
        park.setParkPrice(ResultSetUtil.getBigDecimal(rs, "park_price"));//parkPrice;//park_price  decimal(10,2)
        park.setParkType(ResultSetUtil.getInt(rs, "park_type"));//parkType;//park_type   int(1)
        park.setParkStatus(ResultSetUtil.getInt(rs, "park_status"));//parkStatus;//park_status int(11)
        park.setNetworkId(ResultSetUtil.getString(rs, "network_id"));//networkId;//network_id varchar(32)
        park.setCreateDate(ResultSetUtil.getDateTime(rs, "create_date"));//createDate;//create_date datetime
        park.setModifyDate(ResultSetUtil.getDateTime(rs, "modify_date"));//modifyDate;//modify_date datetime
        park.setDeleteDate(ResultSetUtil.getDateTime(rs, "delete_date"));//deleteDate;//delete_date datetime
        park.setStatus(ResultSetUtil.getInt(rs, "status"));//status;//status  int(11)

        return park;
    }

}
